import axios from '../utils/axios'
// import Province from '../../dbs/models/province'
module.exports = async (ctx) => {
  // 方法一：查询本地数据库的
  // const province = await Province.find()
  // ctx.body = {
  //   province
  // }
  // 方法二：调用线上服务
  const {
    status,
    data: {
      province
    }
  } = await axios.get('http://cp-tools.cn/geo/province')
  ctx.body = {
    province: status === 200 ? province : []
  }
}
